using System;
using System.Collections.Generic;
using Onion.Core;
using Onion.Core.Repositories;
using Onion.Infrastructure.DataAccess;

namespace Onion.Infrastructure
{
   public class InversionOfControlContainer : IInversionOfControlContainer
   {
      readonly IDictionary<Type, object> _myContainer = new Dictionary<Type, object>();

      public InversionOfControlContainer()
      {
         _myContainer.Add(
            typeof (IReasonRepository),
            new ReasonRepository());
      }

      public T Resolve<T>()
      {
         return (T)_myContainer[typeof (T)];
      }
   }
}